<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    .box_1 {
        float: left;
        margin-right: 50px;
    }

    .box {
        width: 300px;
        height: 40px;
        text-align: center;
        line-height: 40px;
        background: yellow;
    }

    .box1 {
        width: 300px;
        height: 500px;
        background: red;
        text-align: center;
        line-height: 500px;
    }

    .box_2 {
        float: left;
        margin-right: 50px;
    }

    .box2 {
        width: 300px;
        height: 40px;
        background: yellow;
        text-align: center;
        line-height: 40px;
    }

    .box3 {
        width: 300px;
        height: 500px;
        background: red;
        text-align: center;
        line-height: 500px;
        display: none;
    }

    .box_3 {
        float: left;
        margin-right: 50px;
    }

    .box4 {
        width: 300px;
        height: 40px;
        background: yellow;
        text-align: center;
        line-height: 40px;
    }

    .box5 {
        width: 300px;
        height: 500px;
        background: red;
        text-align: center;
        line-height: 500px;
    }

    #kai {
        width: 200px;
        height: 40px;
    }

    #guan {
        width: 200px;
        height: 40px;
    }
    .box_4 {
        width: 300px;
        height: 500px;
        float: left;
        margin-right: 50px;
    }
</style>

<body>
    <div class="box_1">
        <div class="box">点我变大</div>
        <div class="box1">我要变大</div>
    </div>
    <div class="box_2">
        <div class="box2">点我滑下面板</div>
        <div class="box3">内容</div>
    </div>
    <div class="box_3">
        <div class="box4">点我有惊喜哦</div>
        <div class="box5">惊喜在这</div>
    </div>
    <button id="kai">开灯</button>
    <!-- <button id="guan">关灯</button> -->
    <div class="box_4">
        <img src="img/1.png" alt="">
    </div>
</body>
<script>
    $(function () {
        // 变大
        $(document).ready(function () {
            $('.box').click(function () {
                $('.box1').animate({ width: '700px', height: '700px', opacity: '0.3' })
                $('.box1').animate({ fontSize: '100px', opacity: '0.3' })
            })
        })

        // 滑动
        $(document).ready(function () {
            $('.box2').click(function () {
                $('.box3').slideDown()
            })
        })

        // 开关灯
        $('#kai').click(function(){
            var but = $('#kai').html()
            $('img').attr('src','img/2.png')
            $(this).html('关灯')
            if (but == '关灯') {
                $('img').attr('src','img/1.png')
                $(this).html('开灯')
            }
        })

    })
</script>

</html>